package com.cjk.console.job;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cjk.foundation.dao.WatchLogDao;

@Component
public class WatchLogMonthClearJob implements Job {
	
	@Autowired
	private WatchLogDao watchLogDao;

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		Date date = new Date(new Date().getTime() - 31 * 24 * 60 * 60 * 1000);
		watchLogDao.deleteByCreateTime(date);
	}

}
